﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Text;

namespace ST.Common.Util.Mvc
{
	public partial class ResultData
	{
		/// <summary>
		/// 结果
		/// </summary>
		public bool r { get; set; }

		/// <summary>
		/// 提示消息
		/// </summary>
		public string m { get; set; }

		/// <summary>
		/// 数据
		/// </summary>
		public object data { get; set; }

		/// <summary>
		/// 响应代码
		/// </summary>
		public int code { get; set; }

		public ResultData()
		{
		}

		public ResultData(object _data, HttpStatusCode statusCode = HttpStatusCode.OK)
		{
			r = _data != null;
			code = (int)statusCode;
			data = _data;
		}

		public ResultData(bool _success, string _msg, HttpStatusCode statusCode = HttpStatusCode.OK)
		{
			r = _success;
			m = _msg;
			code = (int)statusCode;
		}

		public ResultData(bool _success, string _msg, int statusCode)
		{
			r = _success;
			m = _msg;
			code = statusCode;
		}
	}
}
